# -*- coding=utf-8 -*-
import jeepay
from jeepay.app_config import AppConfig

# 配置信息
api_key = "liC2rbnH0SJFWlVzwncM7FZeF6abLNE0s2EFPsK8ZVoTYVddBS3rX39tZX5jIrsdhA4EgNHilhhvqtCNK0quh8SIWBAWxb7HHjHcV4m9SBIptdBzXWLOmisRJF933qAm"
AppConfig.set_mch_no("M1679219294")
AppConfig.set_app_id("6416da5ee4b00bed884be286")
AppConfig.set_api_key(api_key)

"""
支付 API 文档：https://docs.jeequan.com/docs/jeepay/index
"""

print("分账绑定用户")
try:
    bind_user = jeepay.Division.bind_user(
        ifCode="zftpay",  # 接口代码
        receiverAlias="15521254124",  # 接收者账号别名
        receiverGroupId=100048,  # 组ID
        accType=0,  # 分账接收账号类型
        accNo="15521254124",  # 分账接收账号
        relationType="PARTNER",  # 分账关系类型
        divisionProfit=0.3  # 默认分账比例(若分账30% 则填入 0.3)
    )
    print(bind_user)
except Exception as e:
    print(e)
